package com.darren.euc.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 汉王设备
 * Created by IIS72013 2018/3/31.
 */
@Entity
@Table(name = "euc_han_wang")
public class HanWangDoor extends BaseEntity implements Serializable {

	private static final long serialVersionUID = -7447978834343549156L;
	
	@Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(name = "device_name",columnDefinition = "varchar(255) default '' comment '设备名称'")
    private String deviceName;
    
    @Column(name = "device_number",columnDefinition = "varchar(255) default '' comment '硬件编号/硬件ID'")
    private String deviceNumber;
    
    @Column(name = "device_ip",columnDefinition = "varchar(64) default '' comment '设备IP'")
    private String ip;
    
    @Column(name = "device_port",columnDefinition = "int default 9922 comment '设备端口'")
    private Integer port;    
    
    @Column(name = "password",columnDefinition = "varchar(64) default '' comment '通信密码'")
    private String password;
    
    /**
     * 所属空间ID
     */
    @Column(name = "space_id",columnDefinition = "int default 0 comment '所属空间ID'")
    private Integer spaceId;    
    
    /**
     * 所属空间名称
     */
    @Column(name = "space_name",columnDefinition = "varchar(255) default '' comment '所属空间名称'")
    private String spaceName;  

    
    /**
     * 安装位置
     */
    @Column(name = "room_id",columnDefinition = "int default 0 comment '所属房间ID'")
    private Integer roomId;    
    
    /**
     * 安装位置
     */
    @Column(name = "room_name",columnDefinition = "varchar(255) default '' comment '所属房间名称'")
    private String roomName; 

    
    /**
     * 连接状态
     */
    @Column(name = "connect_status",columnDefinition = "int default 2 comment '1: 已连接;2: 未连接'")
    private Integer connectStatus;  
    
    /**
     * 最后一次连接时间
     */
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Column(name = "last_connect_time",columnDefinition = "datetime comment '最后一次连接时间'")
    private Date lastConnectTime;
    
    /**
     * 是否为主设备，每个空间只允许指定一台主设备,true 主设备；false 副设备
     */
    @Column(name = "main",columnDefinition = "tinyint default 0 comment '是否为主设备，每个空间只允许指定一台主设备,true 主设备；false 副设备'")
	private boolean main = false;
    
    
    /**
     * 是否为公共设备，比如会议室，大门口的设备，所有人都可以开门,true 主设备；false 副设备
     */
    @Column(name = "common",columnDefinition = "tinyint default 0 comment '是否为公共设备，比如会议室，大门口的设备，所有人都可以开门,true 公共设备；false 非公共设备'")
	private boolean common = false;
    
    /**
     * 数据状态，是否可用：true是有效数据；false 是已删除数据
     */
    @Column(name = "enable",columnDefinition = "tinyint default 1 comment '数据状态，是否可用：true是有效数据；false 是已删除数据'")
	private boolean enable = true;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getDeviceName() {
		return deviceName;
	}

	public void setDeviceName(String deviceName) {
		this.deviceName = deviceName;
	}

	public String getDeviceNumber() {
		return deviceNumber;
	}

	public void setDeviceNumber(String deviceNumber) {
		this.deviceNumber = deviceNumber;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public Integer getPort() {
		return port;
	}

	public void setPort(Integer port) {
		this.port = port;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Integer getSpaceId() {
		return spaceId;
	}

	public void setSpaceId(Integer spaceId) {
		this.spaceId = spaceId;
	}

	public String getSpaceName() {
		return spaceName;
	}

	public void setSpaceName(String spaceName) {
		this.spaceName = spaceName;
	}

	public Integer getRoomId() {
		return roomId;
	}

	public void setRoomId(Integer roomId) {
		this.roomId = roomId;
	}

	public String getRoomName() {
		return roomName;
	}

	public void setRoomName(String roomName) {
		this.roomName = roomName;
	}

	public Integer getConnectStatus() {
		return connectStatus;
	}

	public void setConnectStatus(Integer connectStatus) {
		this.connectStatus = connectStatus;
	}

	public Date getLastConnectTime() {
		return lastConnectTime;
	}

	public void setLastConnectTime(Date lastConnectTime) {
		this.lastConnectTime = lastConnectTime;
	}

	public boolean isMain() {
		return main;
	}

	public void setMain(boolean main) {
		this.main = main;
	}
	
	public boolean isCommon() {
		return common;
	}

	public void setCommon(boolean common) {
		this.common = common;
	}

	public boolean isEnable() {
		return enable;
	}

	public void setEnable(boolean enable) {
		this.enable = enable;
	}
    
}
